package com.example.sdemo.app.service.impl;

import com.example.sdemo.app.service.StudentService;
import com.example.sdemo.domain.entity.Course;
import com.example.sdemo.domain.entity.Score;
import com.example.sdemo.domain.entity.Student;
import com.example.sdemo.infra.mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Resource
    public StudentMapper studentMapper;
    @Override
    public Student selectById(Integer id) {
        return studentMapper.selectById(id);
    }

    @Override
    public List<Student> selectAll() {
        return studentMapper.selectAll();
    }

    @Override
    public Boolean insert(Student student) {
        return studentMapper.insert(student);
    }

    @Override
    public Boolean delete(Integer id) {
        return studentMapper.delete(id);
    }

    @Override
    public Boolean update(Student student) {
        return studentMapper.update(student);
    }
    @Override
    public List<Score> selectScoreByStudentId(Integer id) {
        return studentMapper.selectScoreByStudentId(id);
    }

    @Override
    public List<Course> selectCourseByStudentId(Integer id) {
        return studentMapper.selectCourseByStudentId(id);
    }
}
